
package jfc.core;

import java.awt.Point;
import java.util.LinkedList;
import jfc.ui.GamePanel;

/**
 *  @author Yann Le Gall
 *  ylegall@gmail.com
 *  Oct 28, 2009 7:00:31 PM
 */
public class CardGroup extends LinkedList<Card>
{
    public void setLocation(Point p) {
        getFirst().setLocation(p);
        for(int i=1; i<size(); i++) {
            get(i).setLocation(p.x, p.y+(i*GamePanel.CARDGAP));
        }
    }

    public void moveBy(int dx, int dy) {
        for(Card c : this) {
            c.moveBy(dx, dy);
        }
    }

    public Point getLocation() {
        return getFirst().getLocation();
    }
}
